<template>
	<view class="news tn-safe-area-inset-bottom">
		<tn-nav-bar fixed alpha customBack>
			<view slot="back" class='tn-custom-nav-bar__back' @click="goBack">
				<text class='icon tn-icon-left'></text>
				<text class='icon tn-icon-home-capsule-fill'></text>
			</view>
		</tn-nav-bar>
		
		<!-- 1.分页 -->
		<swiper class="card-swiper" :circular="true" :autoplay="true" duration="500" interval="18000"
			@change="cardSwiper">
			<swiper-item v-for="(item,index) in swiperList" :key="index" :class="cardCur==index?'cur':''">
				<view class="swiper-item image-banner">
					<image :src="item.url" mode="aspectFill" v-if="item.type=='image'"></image>
				</view>

				<div style="display: flex;">
					<div style="width: 50%;">
						<view class="tn-text-df tn-text-bold tnloukong">{{bmtiDetail.name}} - {{bmtiDetail.type_name}}
						</view>

						<view class="swiper-item-text">
							<view class="tn-text-lg tn-text-bold tn-color-white">{{bmtiDetail.personality_traits}}
							</view>
						</view>

					</div <div style="width: 50%;">
					<div style="position: fixed;bottom: 20px;right: 20px;display: flex;">
						<van-image :src="bmtiDetail.image_man" width="140rpx" height="280rpx" />
						<van-image :src="bmtiDetail.image_woman" width="140rpx" height="280rpx" />
					</div>
				</div>
				</div>
			</swiper-item>
		</swiper>


		<!-- 介绍详情 -->
		<view class="" style="padding-bottom: 60rpx;margin-top: -100rpx;z-index: 999; position: relative;">
			<!-- 不建议写时间，因为写了时间，你就要经常更新文章了鸭-->
			<view class="">
				<view class="article-shadow tn-margin tn-bg-white" @click="tn('/newsPages/article')">
					<view class="tn-flex">
						<view class="tn-margin-sm tn-padding-top-xs" style="width: 100%;">

 
							<!-- 画像 -->
							<view class="shadowBox">
								<view class="tn-text-lg tn-text-bold clamp-text-1 tn-text-justify">
									<MainTitle :transferTitle="'基本画像'" />
								</view>
								<view class="tn-padding-top-sm" style="min-height: 90rpx;">
									<text class="tn-text-df tn-color-gray  tn-text-justify">
										{{ bmtiDetail.personality_detail }}
									</text>
								</view>
							</view>


							<!-- 代表 -->
							<view class="shadowBox">
								<view class="tn-text-lg tn-text-bold clamp-text-1 tn-text-justify">
									<MainTitle :transferTitle="'这4个字母代表什么'" />
								</view>

								<view class="tn-padding-top-xs" style="min-height: 90rpx;">
									<block v-for="item in bmtiDetail.letterList" :key="item.id">
										<div style="display: flex;align-items: center;margin-bottom: 15rpx;">
											<view class="iconTag">
												{{item.letter}}
											</view>


											<div class="tn-text-df tn-color-black clamp-text-1 tn-text-md"
												style="font-weight: bold; margin-left: 10rpx;width: 80rpx;text-align: center;">
												{{item.letter_info}}
											</div>

											<div style="margin-left: 20rpx;font-weight: bold;width: 70%;"
												class="tn-text-df tn-color-gray clamp-text-2 tn-text-md">
												{{item.letter_detail}}
											</div>
										</div>

									</block>
								</view>
							</view>

							<!-- 性格优点 -->
							<view class="shadowBox">
								<view class="tn-text-lg tn-text-bold clamp-text-1 tn-text-justify">
									<MainTitle :transferTitle="'性格优点'" />
								</view>

								<view class="tn-padding-top-xs" style="min-height: 90rpx;">
									<block v-for="item in bmtiDetail.characteryoudianList" :key="item.id">
										<div style="display: flex;flex-direction: column;">
											<div
												class="youdianTag  tn-text-md tn-text-bold clamp-text-1 tn-text-justify">
												{{item.character_tag}}
											</div>

											<div style="margin-left: 20rpx;margin-top: 10rpx;margin-bottom: 10rpx;"
												class="tn-text-df tn-color-gray  tn-text-justify">
												{{item.character_detail}}
											</div>
										</div>

									</block>
								</view>
							</view>


							<!-- 性格缺点 -->
							<view class="shadowBox">
								<view class="tn-text-lg tn-text-bold clamp-text-1 tn-text-justify">
									<MainTitle :transferTitle="'性格缺点'" />
								</view>

								<view class="tn-padding-top-xs" style="min-height: 90rpx;">
									<block v-for="item in bmtiDetail.characterquedianList" :key="item.id">
										<div style="display: flex;flex-direction: column;">
											<div
												class="quedianTag  tn-text-md tn-text-bold clamp-text-1 tn-text-justify">
												{{item.character_tag}}
											</div>

											<div style="margin-left: 20rpx;margin-top: 10rpx;margin-bottom: 10rpx;"
												class="tn-text-df tn-color-gray  tn-text-justify">
												{{item.character_detail}}
											</div>
										</div>

									</block>
								</view>
							</view>


							<!-- 名人 -->
							<view class="shadowBox">
								<view class="tn-text-lg tn-text-bold clamp-text-1 tn-text-justify">
									<MainTitle :transferTitle="'名人名家'" />
								</view>

								<view class="tn-padding-top-xs" style="min-height: 90rpx;">

									<div style="display: flex;    justify-content: space-between;">

										<div v-for="item in bmtiDetail.celebrityList" :key="item.id"
											style="display: flex;flex-direction: column;justify-content: center;">
											<van-image width="150rpx" height="150rpx"
												:src="item.celebrity_image" />

											<div style="text-align: center;"
												class="tn-text-lg tn-text-bold clamp-text-1 tn-text-justify">
												{{item.celebrity_name}}
											</div>
										</div>

									</div>
								</view>


							</view>




						</view>


					</view>
				</view>
			</view>
		</view>






		<view class='tn-tabbar-height'></view>


	</view>
</template>

<script>
	import {
		BMTIBMTIType,
		BMTIBMTIDetail
	} from '@/api/bmti.js'
	import MainTitle from '@/components/MainTItle/mainTitle.vue'

	export default {
		name: 'News',
		components: {
			MainTitle
		},

		data() {
			return {
				bmtiDetail: {},




				cardCur: 0,
				swiperList: [],
				groupList: [{
						src: 'https://cdn.nlark.com/yuque/0/2022/jpeg/280373/1663570648127-assets/web-upload/b8625625-2a52-47f9-a27c-adf6becd3c94.jpeg'
					},
					{
						src: 'https://cdn.nlark.com/yuque/0/2022/jpeg/280373/1663570648152-assets/web-upload/410aa585-dd43-4e9a-912c-fc8c04e0e8f9.jpeg'
					},
					{
						src: 'https://cdn.nlark.com/yuque/0/2022/jpeg/280373/1663571007436-assets/web-upload/e3fdeb91-d8d1-4187-8d91-593559543af3.jpeg'
					},
					{
						src: 'https://cdn.nlark.com/yuque/0/2022/jpeg/280373/1663570648186-assets/web-upload/244e6b96-177a-40e6-953d-3ab080c22793.jpeg'
					},
					{
						src: 'https://cdn.nlark.com/yuque/0/2022/jpeg/280373/1663570648156-assets/web-upload/3b9aa10c-36ca-43ff-9321-38fd1d3dfffc.jpeg'
					},
				],

				// 详情model
				detailInfo: {},
			}
		},
		onLoad(item) {
			if (item) {
				this.interfaceBMTIBMTIDetail(item);
			}

		},

		created() {

		},
		methods: {
			goBack() {
				uni.navigateBack();
			},
			// cardSwiper
			cardSwiper(e) {
				this.cardCur = e.detail.current
			},
			clickNowManager() {
				uni.navigateTo({
					url: '/pages/question/index?partId=' + this.transferItem.partId
				})
			},
			// 跳转
			tn(e) {
				uni.navigateTo({
					url: e,
				});
			},

			interfaceBMTIBMTIDetail(item) {
				var that = this;
				var params = {
					id: item.id
				}

				BMTIBMTIDetail(params).then(res => {
					that.bmtiDetail = res;
					// swip
					var item = {
						id: 0,
						type: 'image',
						title: '我不喜欢带伞',
						name: '因为雨水从不滴落在我心上',
						url: res.ablum,
					}
					that.swiperList = [item];
					
				});
			}
		}
	}
</script>

<style lang="scss" scoped>
	.news {
		max-height: 100vh;
	}

	/* 自定义导航栏内容 start */
	.custom-nav {
		height: 100%;

		&__back {
			margin: auto 5rpx;
			font-size: 50rpx;
			margin-right: 10rpx;
			margin-left: 30rpx;
			flex-basis: 5%;
		}

		&__search {
			flex-basis: 60%;
			width: 100%;
			height: 100%;

			&__box {
				width: 100%;
				height: 70%;
				padding: 10rpx 0;
				margin: 0 30rpx;
				border-radius: 60rpx 60rpx 0 60rpx;
				font-size: 24rpx;
			}

			&__icon {
				padding-right: 10rpx;
				margin-left: 20rpx;
				font-size: 30rpx;
			}

			&__text {
				// color: #AAAAAA;
			}
		}
	}

	/* 底部安全边距 start*/
	.tn-tabbar-height {
		min-height: 120rpx;
		height: calc(140rpx + env(safe-area-inset-bottom) / 2);
		height: calc(140rpx + constant(safe-area-inset-bottom));
	}

	/* 文字截取*/
	.clamp-text-1 {
		-webkit-line-clamp: 1;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		text-overflow: ellipsis;
		overflow: hidden;
	}

	.clamp-text-2 {
		-webkit-line-clamp: 2;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		text-overflow: ellipsis;
		overflow: hidden;
	}

	/* 镂空 */
	.tnloukong {
		position: fixed;
		padding: 4rpx 8rpx;
		bottom: 220rpx;
		border-radius: 5rpx;
		left: 30rpx;
		font-weight: bold;
		text-align: center;
		z-index: 1000;
		background: rgba(255, 255, 255, 1);
		color: #070707;
		/* mix-blend-mode: overlay; difference;lighten;hue*/
		mix-blend-mode: lighten;

	}


	/* 轮播视觉差 start */
	.card-swiper {
		height: 500rpx !important;
	}

	.card-swiper swiper-item {
		width: 750rpx !important;
		left: 0rpx;
		box-sizing: border-box;
		// padding: 0rpx 30rpx 90rpx 30rpx;
		overflow: initial;
	}

	.card-swiper swiper-item .swiper-item {
		width: 100%;
		display: block;
		height: 100%;
		transform: scale(1);
		transition: all 0.2s ease-in 0s;
		will-change: transform;
		overflow: hidden;
	}

	.card-swiper swiper-item.cur .swiper-item {
		transform: none;
		transition: all 0.2s ease-in 0s;
		will-change: transform;
	}

	.card-swiper swiper-item .swiper-item-text {
		margin: -200rpx 0 0 30rpx;
		width: 100%;
		transition: all 0.6s ease 0s;
		will-change: transform;
	}



	.image-banner {
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.image-banner image {
		width: 100%;
		height: 100%;
	}

	/* 轮播指示点 start*/
	.indication {
		z-index: 9999;
		width: 100%;
		height: 36rpx;
		position: absolute;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: center;
	}

	.spot {
		background-color: #FFFFFF;
		opacity: 0.6;
		width: 30rpx;
		height: 6rpx;
		border-radius: 0rpx;
		left: -275rpx;
		top: -130rpx;
		margin: 0 5rpx !important;
		position: relative;
	}

	.spot.active {
		opacity: 1;
		width: 30rpx;
		background-color: #FFFFFF;
	}


	/* 阴影 start*/
	.home-shadow {
		border-radius: 15rpx;
		box-shadow: 0rpx 0rpx 50rpx 0rpx rgba(0, 0, 0, 0.07);
	}


	/* 资讯主图 start*/
	.image-article {
		border-radius: 8rpx;
		width: 200rpx;
		height: 200rpx;
		position: relative;
	}

	.image-pic {
		border: 1rpx solid #F8F7F8;
		background-size: cover;
		background-repeat: no-repeat;
		// background-attachment:fixed;
		background-position: top;
		border-radius: 10rpx;
	}

	.article-shadow {
		border-radius: 15rpx;
		box-shadow: 0rpx 0rpx 50rpx 0rpx rgba(0, 0, 0, 0.07);
	}

	/* 文字截取*/
	.clamp-text-1 {
		-webkit-line-clamp: 1;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		text-overflow: ellipsis;
		overflow: hidden;
	}

	.clamp-text-2 {
		-webkit-line-clamp: 2;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		text-overflow: ellipsis;
		overflow: hidden;
	}

	/* 标签内容 start*/
	.tn-tag-content {
		&__item {
			display: inline-block;
			line-height: 35rpx;
			color: #1D2541;
			background-color: #F3F2F7;
			border-radius: 10rpx;
			font-size: 22rpx;
			padding: 5rpx 15rpx;

			&--prefix {
				padding-right: 10rpx;
			}
		}
	}


	/* 大单图 start*/
	.tn-blogger-content2 {
		&__wrap {
			padding: 30rpx;
		}

		&__info {
			&__btn {
				margin-right: -12rpx;
				opacity: 0.5;
			}
		}

		&__label {
			&__item {
				line-height: 45rpx;
				padding: 0 20rpx;
				margin: 5rpx 18rpx 0 0;

				&--prefix {
					color: #00FFC8;
					padding-right: 10rpx;
				}
			}

			&__desc {
				line-height: 55rpx;
			}
		}

		&__main-image {
			box-shadow: 0rpx 5rpx 40rpx 0rpx rgba(43, 158, 246, 0.2);
			border-radius: 16rpx;

			&--1 {
				max-width: 690rpx;
				min-width: 690rpx;
				max-height: 400rpx;
				min-height: 400rpx;
			}

			&--2 {
				max-width: 260rpx;
				max-height: 260rpx;
			}

			&--3 {
				height: 212rpx;
				width: 100%;
			}
		}

		&__count-icon {
			font-size: 40rpx;
			padding-right: 5rpx;
		}
	}

	.image-design {
		padding: 140rpx 0rpx;
		font-size: 40rpx;
		font-weight: 300;
		position: relative;
	}

	.image-pic {
		background-size: cover;
		background-repeat: no-repeat;
		// background-attachment:fixed;
		background-position: top;
		border-radius: 10rpx;
	}

	/* 文章内容 end*/



	/* 底部安全边距 start*/
	.tn-tabbar-height {
		min-height: 120rpx;
		height: calc(140rpx + env(safe-area-inset-bottom) / 2);
		height: calc(140rpx + constant(safe-area-inset-bottom));
	}

	.tn-footerfixed {
		position: fixed;
		background-color: rgba(255, 255, 255, 0.5);
		box-shadow: 0rpx 0rpx 30rpx 0rpx rgba(0, 0, 0, 0.07);
		bottom: 0;
		width: 100%;
		transition: all 0.25s ease-out;
		z-index: 100;
	}

	/* 文字截取*/
	.clamp-text-1 {
		-webkit-line-clamp: 1;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		text-overflow: ellipsis;
		overflow: hidden;
	}

	.clamp-text-2 {
		-webkit-line-clamp: 2;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		text-overflow: ellipsis;
		overflow: hidden;
	}

	/* 用户头像 start */
	.shop-image {
		width: 35rpx;
		height: 35rpx;
		position: relative;
		overflow: hidden;
		border-radius: 50%;
	}

	.shop-pic {
		background-size: cover;
		background-repeat: no-repeat;
		// background-attachment:fixed;
		background-position: top;
		border: 1rpx solid rgba(255, 255, 255, 0.05);
		box-shadow: 0rpx 0rpx 80rpx 0rpx rgba(0, 0, 0, 0.15);
		border-radius: 50%;
		overflow: hidden;
		// background-color: #FFFFFF;
	}


	/* 阴影 start*/
	.nav-shadow {
		border-radius: 15rpx;
		box-shadow: 0rpx 0rpx 50rpx 0rpx rgba(0, 0, 0, 0.07);
	}


	/* 用户头像 start */
	.nav-image {
		width: 35rpx;
		height: 35rpx;
		position: relative;
		overflow: hidden;
		border-radius: 50%;
	}

	.nav-pic {
		background-size: cover;
		background-repeat: no-repeat;
		// background-attachment:fixed;
		background-position: top;
		border: 1rpx solid rgba(255, 255, 255, 0.05);
		box-shadow: 0rpx 0rpx 80rpx 0rpx rgba(0, 0, 0, 0.15);
		border-radius: 50%;
		overflow: hidden;
		// background-color: #FFFFFF;
	}

	.icon12 {
		&__item {
			width: 30%;
			background-color: #FFFFFF;
			border-radius: 10rpx;
			padding: 30rpx;
			margin: 20rpx 10rpx;
			transform: scale(1);
			transition: transform 0.3s linear;
			transform-origin: center center;

			&--icon {
				width: 100rpx;
				height: 100rpx;
				font-size: 60rpx;
				border-radius: 50%;
				margin-bottom: 18rpx;
				position: relative;
				z-index: 1;

				&::after {
					content: " ";
					position: absolute;
					z-index: -1;
					width: 100%;
					height: 100%;
					left: 0;
					bottom: 0;
					border-radius: inherit;
					opacity: 1;
					transform: scale(1, 1);
					background-size: 100% 100%;
					background-image: url(https://resource.tuniaokj.com/images/cool_bg_image/icon_bg.png);


				}
			}
		}
	}


	/* 用户头像 start */
	.logo-image {
		width: 85rpx;
		height: 85rpx;
		position: relative;
		overflow: hidden;
		border-radius: 50%;
	}

	.logo-pic {
		background-size: cover;
		background-repeat: no-repeat;
		// background-attachment:fixed;
		background-position: top;
		border: 1rpx solid #F8F7F8;
		// box-shadow: 0rpx 0rpx 80rpx 0rpx rgba(0, 0, 0, 0.15);
		border-radius: 50%;
		overflow: hidden;
		// background-color: #FFFFFF;
	}

	/* 用户头像 start */
	.logo-image2 {
		width: 45rpx;
		height: 45rpx;
		position: relative;
		overflow: hidden;
		border-radius: 50%;
	}

	.logo-pic2 {
		background-size: cover;
		background-repeat: no-repeat;
		// background-attachment:fixed;
		background-position: top;
		border: 1rpx solid #F8F7F8;
		// box-shadow: 0rpx 0rpx 80rpx 0rpx rgba(0, 0, 0, 0.15);
		border-radius: 50%;
		overflow: hidden;
		// background-color: #FFFFFF;
	}

	/* 胶囊*/
	.tn-custom-nav-bar__back {
		width: 100%;
		height: 100%;
		position: relative;
		display: flex;
		justify-content: space-evenly;
		align-items: center;
		box-sizing: border-box;
		background-color: rgba(0, 0, 0, 0.15);
		border-radius: 1000rpx;
		border: 1rpx solid rgba(255, 255, 255, 0.5);
		color: #FFFFFF;
		font-size: 18px;

		.icon {
			display: block;
			flex: 1;
			margin: auto;
			text-align: center;
		}

		&:before {
			content: " ";
			width: 1rpx;
			height: 110%;
			position: absolute;
			top: 22.5%;
			left: 0;
			right: 0;
			margin: auto;
			transform: scale(0.5);
			transform-origin: 0 0;
			pointer-events: none;
			box-sizing: border-box;
			opacity: 0.7;
			background-color: #FFFFFF;
		}
	}

	.shadowBox {
		box-shadow: 0rpx 0rpx 50rpx 0rpx rgba(0, 0, 0, 0.12);
		border-radius: 20rpx;
		margin: 0rpx;
		padding: 20rpx;
		margin-bottom: 30rpx;
	}

	.iconTag {
		width: 50rpx;
		height: 40rpx;
		background-color: #82B2FF;
		border-radius: 4px;
		text-align: center;
		align-items: center;
		line-height: 40rpx;
		font-weight: bold;
		color: white;
	}

	.youdianTag {
		width: 250rpx;
		height: 50rpx;
		border-radius: 4px;
		text-align: center;
		align-items: center;
		line-height: 50rpx;
		font-weight: bold;
		background-color: #24BA97;
		color: white;
	}

	.quedianTag {
		width: 250rpx;
		height: 50rpx;
		border-radius: 4px;
		text-align: center;
		align-items: center;
		line-height: 50rpx;
		font-weight: bold;
		background-color: #F39C97;
		color: white;
	}
</style>